package com.weaponlin.domain.collections;

import com.google.common.collect.Lists;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.IntStream;

public class LinklistTest {

    public static void main(String[] args) {
        List<String> ticketIds = new LinkedList<>();
        IntStream.rangeClosed(1, 1000000).forEach(e -> ticketIds.add(String.valueOf(e)));
        int index = 0;
        while (index < ticketIds.size()) {
            int end = 0;
            if ((index + 100000) < ticketIds.size()) {
                end = index + 100000;
            } else {
                end = ticketIds.size();
            }
            String[] tmp = ticketIds.subList(index, end).toArray(new String[end - index]);
            print(tmp);
            index = end;
        }
    }

    public static void print(String[] tmp) {
//        for (String s : tmp) {
//            System.out.print(s + " ");
//        }
//        System.out.println();
    }
}
